<template>
	<view>
		<view class="nav-bar flex-center">
			<tui-icon v-if="left" name="arrowleft" color="#ffffff" :size="36" @click="lClick"></tui-icon>
			<text class="nav-title">{{title}}</text>
			<text class="tui-icon right-subs" @click="rClick">{{rightText}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		name:"tt-navbar",
		props: {
			left:{
				type:Boolean,
				default:false
			},
			title:{
				type:String,
				default:''
			},
			rightText:{
				type:String,
				default:''
			},
		},
		data() {
			return {
				
			};
		},
		methods:{
			lClick(){
				this.$emit('lclick')
			},
			rClick(){
				this.$emit('rclick')
			}
		}
	}
</script>

<style lang="scss">
	.flex-center {
	    display: flex;
	    align-items: center;
	    justify-content: center;
	}
	.nav-bar {
	    position: relative;
		justify-content: space-between;
		// width: calc(100% - 2rem);
		width: calc(100%);
		height: 5rem;
		font-size: 1.2rem;
		font-weight: 500;
		color: #fff;
		background-image: url(@/static/images/nav-bg.png);
		background-size: 100% 10rem;
		background-repeat: no-repeat;
		padding: 0 1rem;
		
		.right-subs{
			font-size: 12px;
		}
	}
</style>